<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<script type="text/javascript">
$("document").ready(function(){
	
	var params = $(app.popWin).data("data");
	
	params["data_type"] = "json";

	$("#organQz").unbind("click").bind("click",function(){
		
		var ORGAN_STAMP_PASSWORD = $("input[name='ORGAN_STAMP_PASSWORD']","#itemFormQz").val();
		
		if($.trim(ORGAN_STAMP_PASSWORD)==""){
			
			$("#qzMsg").html("操作提示：签章密码不能为空！");
			
		}else{
			
			if(ORGAN_STAMP_PASSWORD == '${param.STAMP_PASSWORD}'){
				
				$.post(basepath+"/${param.nameSpaceQz}/organStamp",params,function(data){

					if(data.success){
						
						 app.popWins["popWin"].close();
						 
						var title = $(".tabs-selected .tabs-title",app.masterModule.config.tabs).html();
						if($.trim(title)==''){
						
							$(".b_jcsh").click();
						}else{
							
							$(app.masterModule.config.tabs).tabs("select",title);
							
						}
						
						
					}else{
						
						$("#qzMsg").html("操作提示：签章失败！请联系系统管理员！");
					}
					
				});
				
			}else{
				
				$("#qzMsg").html("操作提示：签章密码不正确！");
				
			}
			
		}
		
	});
	
	jQuery.parser.parse("#organQzDiv");
	
});
</script>
<div id="organQzDiv" style="height:250px;margin:10px; width: 300px;">
	<form id="itemFormQz" class="core-form">
		<table>
			<tr>
				<td>
		  			<div style="text-align:center;"><img src="<%=request.getContextPath() %>/${param.nameSpaceQz }/getImage?ORGAN_ID=${param.ORGAN_ID }&UID=${param.UID }&random=<%=Math.random()%>&data_type=json" width="144px" height="138px"></div>
		  		</td>
		  	</tr>
		  	<tr>
		  		<td>
		  			<div style="text-align:center;">密钥：<input type="password" name="ORGAN_STAMP_PASSWORD"></div>
		  		</td>
		  	</tr>
		  	<tr>
		  		<td>
		  			<div style="text-align:center;"><a id="organQz" class="core-button form-button" icon="icon-save">签章</a></div>
		  		</td>
			</tr>
			<tr>
		  		<td>
		  			<div id="qzMsg" style="text-align:center;color: red;"></div>
		  		</td>
			</tr>
		</table>
	</form>
</div>